﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Runtime.Serialization;

namespace EFong.Contract
{
    [DataContract]
    public class VendorSettlement
    {
        private Guid _id;
        [DataMember]
        public Guid ID
        {
            get { return _id; }
            set { _id = value; }
        }

        private Guid? _bankAccountID;
        [DataMember]
        public Guid? BankAccountID
        {
            get { return _bankAccountID; }
            set { _bankAccountID = value; }
        }


        private Vendor _vendor;
        [DataMember]
        public Vendor Vendor
        {
            get { return _vendor; }
            set { _vendor = value; }
        }


        private DateTime _postingDate;
        [DataMember]
        public DateTime PostingDate
        {
            get { return _postingDate; }
            set { _postingDate = value; }
        }

        private BankAccount _bankAccount;
        [DataMember]
        public BankAccount BankAccount
        {
            get { return _bankAccount; }
            set { _bankAccount = value; }
        }

        private string _checkNo = string.Empty;
        [DataMember]
        public string CheckNo
        {
            get { return _checkNo; }
            set { _checkNo = value; }
        }

        private decimal _amount;
        [DataMember]
        public decimal Amount
        {
            get { return _amount; }
            set { _amount = value; }
        }

        private Currency _currency;
        [DataMember]
        public Currency Currency
        {
            get { return _currency; }
            set { _currency = value; }
        }

        public string Money
        {
            get
            {
                if (Currency == null)
                    return string.Empty;

                return string.Format("{0} {1}", Currency.Name, Amount);
            }
        }

        private string _orderRef = string.Empty;
        [DataMember]
        public string OrderRef 
        {
            get { return _orderRef; }
            set { _orderRef = value; }
        }

        private string _orderType = string.Empty;
        [DataMember]
        public string OrderType
        {
            get { return _orderType; }
            set { _orderType = value; }
        }

        private string _remark = string.Empty;
        [DataMember]
        public string Remark
        {
            get { return _remark; }
            set { _remark = value; }
        }

        private string _paymentType = string.Empty;
        [DataMember]
        public string PaymentType
        {
            get { return _paymentType; }
            set { _paymentType = value; }
        }

        private decimal _exchangeRate = 1;
        [DataMember]
        public decimal ExchangeRate
        {
            get { return _exchangeRate; }
            set { _exchangeRate = value; }
        }

    }
}
